
import request from "@/utils/functions/request";

// 流转配置查询
export function ledgerMenuTosetTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-toset-do/ledgerMenuTosetTab",
    method: "get",
    params
  });
}

// 表格数据查询
export function ledgerTabApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-do/ledgerTab",
    method: "post",
    data
  });
}

// 根据菜单名称查询表
export function ledgerMenuTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/ledgerMenuTab",
    method: "get",
    params
  });
}

// 根据表 id 查询
export function ledgerMenuTableFieldListApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/ledgerMenuTableFieldList",
    method: "get",
    params
  });
}

// 查询功能
export function ledgerMenuFuncTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-func-do/ledgerMenuFuncTab",
    method: "get",
    params
  });
}

// 根据菜单 id 查询查询
export function ledgerMenuQueryTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-query-do/ledgerMenuQueryTab",
    method: "get",
    params
  });
}

// 新增自定义表头配置
export function ledgerTableSortFormListApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-table-sort-do/ledgerTableSortFormList",
    method: "post",
    data
  });
}

// 查看表头排序信息
export function ledgerTableSortTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-table-sort-do/ledgerTableSortTab",
    method: "get",
    params
  });
}

// 获取字段对应的数据
export function ledgerFieldSelectTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-field-select-do/ledgerFieldSelectTab",
    method: "get",
    params
  });
}

// 人员列表
export function userListApi(): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/userList",
    method: "get"
  });
}

// 新增数据
export function ledgerFormApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-do/ledgerForm",
    method: "post",
    data
  });
}

// 删除数据
export function ledgerDelApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-do/ledgerDel",
    method: "get",
    params
  });
}

// 多文件上传
export function uploadApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-do/upload",
    method: "post",
    headers: {
      "Content-Type": "application/form-data;charset=utf-8"
    },
    data,
  });
}

// 导入数据
export function ledgerImportApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-do/ledgerImport",
    method: "post",
    headers: {
      "Content-Type": "application/form-data;charset=utf-8"
    },
    data
  });
}

// 获取用户信息
export function getUserInfoApi(data: any = {}): Promise<any> {
  return request({
    url: "/cquser/user_user/getUserInfo",
    method: "post",
    data
  });
}

// 添加审核记录
export function ledgerAuditRecordFormApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-audit-do/ledgerAuditRecordForm",
    method: "post",
    data
  });
}

// 查询审核记录
export function ledgerAuditRecordTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-audit-do/ledgerAuditRecordTab",
    method: "get",
    params
  });
}

// 提交流转
export function ledgerRoamApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-do/ledgerRoam",
    method: "post",
    data
  });
}

// 查询组织
export function organListApi(): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/organList",
    method: "get"
  });
}

// 获取组织树
export function getRoleRightTreeApi(params: any): Promise<any> {
  return request({
    url: "/cquser/user_role/getRoleRightTree",
    method: "get",
    params
  });
}